/**
 * App Store
 */
import { defineStore } from "pinia";
import { GlobalConfig, StoreID } from "@/config";
import { persistedStateConfig } from "@/config";

/**
 * 应用状态存储
 */
export const useAppStore = defineStore(StoreID.APP_STORE, {
    state: (): AppState => {
        return {
            token: "",
            userInfo: {},
        };
    },

    getters: {},

    actions: {
        /** 设置令牌 */
        setToken(token: string) {
            this.token = token;
        },
        /** 用户信息 */
        setUserInfo(userInfo: any) {
            this.userInfo = userInfo;
        },
        /** 组件尺寸 */
        // setAssemblySizeSize(assemblySize: AssemblySizeType) { this.assemblySize = assemblySize; },
        /** 主题配置 */
        // setThemeConfig(value: ThemeConfig) { this.themeConfig = value },
    },

    persist: true,
});
